package com.xsg.printer.core.enums;

public enum FontFamilyEnum {
    SONG(1, "宋体"),

    BOLD(2, "黑体"),

    LU(3, "隶书"),

    REGULAR(4, "楷体"),
    ;

    private Integer type;

    private String name;

    FontFamilyEnum(int type, String name) {
        this.type = type;
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public static String getNameByType(Integer type) {
        for (FontFamilyEnum value : values()) {
            if(value.getType().equals(type)){
                return value.getName();
            }
        }
        return FontFamilyEnum.BOLD.getName();
    }
}
